package com.mike.uaa.server.authentication.processors;

import com.mike.uaa.core.Authentication;
import com.mike.uaa.web.redis.AuthenticationRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * @author z zhang
 */
@Component
@RequiredArgsConstructor
public class AuthenticationStoragePostProcessor implements AuthenticationPostProcessor{

    private final AuthenticationRepository authenticationRepository;

    @Override
    public Authentication process(Authentication authentication) {
        authenticationRepository.save(authentication);
        return authentication;
    }
}
